from django.db import models

# Create your models here.
class Student(models.Model):
    TYPE = (('0','男'),('1','女'))
    TYPE1 = (('0','人工'),('1','传媒'),('2','网站'))
    # 姓名
    name = models.CharField(max_length=255,null=False)
    # 年龄
    age = models.IntegerField()
    # 性别
    sex = models.CharField(max_length=1,choices=TYPE)
    # 电话
    phone = models.CharField(max_length=11,null=False)
    # 住址
    address = models.CharField(max_length=255,null=False)
    # 照片
    img = models.CharField(max_length=255)
    # 专业
    specialty = models.CharField(max_length=1,choices=TYPE1)
class Teacher(models.Model):
    TYPE = (('0','男'),('1','女'))
    TYPE1 = (('0','人工'),('1','传媒'),('2','网站'))
    # 姓名
    name = models.CharField(max_length=255,null=False)
    # 年龄
    age = models.IntegerField()
    # 性别
    sex = models.CharField(max_length=1,choices=TYPE)
    # 电话
    phone = models.CharField(max_length=11,null=False)
    # 住址
    address = models.CharField(max_length=255,null=False)
    # 照片
    img = models.CharField(max_length=255)
    # 专业
    specialty = models.CharField(max_length=1,choices=TYPE1)
    relation = models.ForeignKey(Student,on_delete=models.CASCADE,null=False)

class Longin(models.Model):
    name=models.CharField('教师姓名',max_length=30)
    password=models.CharField('教师密码',max_length=30)
class Longin1(models.Model):
    name=models.CharField('学生姓名',max_length=30)
    password=models.CharField('学生密码',max_length=30)